package com.example.mybatis_demo.mapper;

import com.example.mybatis_demo.model.ArticleInfo;
import com.example.mybatis_demo.model.UserInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface ArticleInfoMapper {

    @Select("select * from articleInfo where id = #{articleId}")
    ArticleInfo selectArticleById(Integer articleId);

    @Select("select a.*,u.username,u.age,u.gender from articleInfo a left join userInfo u on a.uid = u.id where a.id = #{articleId}")
    ArticleInfo selectArticleAndUserById(Integer articleId);


}
